<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/static/admin/jsp/include.jsp"%>
<script type="text/javascript">
	var id = "${id}";
	var submitForm = function($dialog, $grid, $pjq) {
		if ($('form').form('validate')) {
			var obj=sy.serializeObject($('form'));
			obj.userState = 1;
            obj.userType = 1;
            obj.isVip = 0;
            obj.isVerify = 1;
			obj.isBindQq = 0;
            obj.isBindWeibo = 0;
            obj.isBindWeixin = 0;
			var url=sy.contextPath + '/user/save';
			$.post(url, obj, function(result) {
				if (result.code == 0) {
					$grid.datagrid('reload');
					$dialog.dialog('destroy');
				} else {
					$pjq.messager.e('保存失败,'+result.msg);
				}
			}, 'json');
		}
	};
	
	$(function() {
		if (id != '') {
			parent.$.messager.progress({
				text : '数据加载中....'
			});
			$.post(sy.contextPath + '/user/findById', {
				id : id
			}, function(result) {
				if (result) {
					$('form').form('load', result);
				}
				parent.$.messager.progress('close');
			}, 'json');
		}

		$("#experience").textbox({
			onChange : function (result,data) {
				console.log(result);
				    $("#data").html(result.length);

            }
		})
	});

</script>
</head>
<body>
	<form id="form" method="post">
        <input name="id" type="hidden" />
        <div style="padding:15px;font-size: 12px">
            <table style="table-layout:fixed;" border="0" cellspacing="0" class="formtable">
		    	<tr>
		    		<th style="width:100px;">真实姓名：</th>
		    		<td>
		    			<input id="userName" name="userName" class="easyui-textbox" missingMessage="请输入" prompt="请输入" style="width:90%;"
		    				data-options="required:true" />
		    		</td>
		    	</tr>
		    	<tr>
		    		<th style="width:100px;">头像(建议尺寸140*140)：</th>
					<td>
						<div id="artImg" multi="false" fileCountLimit="1" type="file" showImage="true" bestSize="640*320" fileType="jpg,png" showWidth="40" showHeight="40" fileSize="2MB" buttonText="上传艺术家头像" url="fileUpload"></div>
					</td>
		    	</tr>
		    	<tr>
		    		<th style="width:100px;">联系方式(默认账号:密码为123456)：</th>
		    		<td>
						<input id="artPhone" name="artPhone" class="easyui-textbox" missingMessage="请输入" prompt="请输入" style="width:90%;"
							   data-options="required:false" />
		    		</td>
		    	</tr>
		    	<tr>
		    		<th style="width:100px;">常用邮箱：</th>
		    		<td>
						<input id="artEmail" name="artEmail" class="easyui-textbox" missingMessage="请输入" prompt="请输入" style="width:90%;"
							   data-options="required:false" />
		    		</td>
		    	</tr>
		    	<tr>
					<th style="width:100px;">个人简介：</th>
					<td>
						<input id="artInfo" name="artInfo" class="easyui-textbox" style="height: 200px"  data-options="required:true,multiline:true,validType:['length[0,500]']" missingMessage="请输入消息内容" prompt="请输入消息内容"></input>
					</td>
		    	</tr>
				<tr>
					<th style="width:100px;">毕业学校：</th>
					<td>
						<input id="school" name="school" class="easyui-textbox" missingMessage="请输入" prompt="请输入" style="width:90%;"
							   data-options="required:false" />
					</td>
				</tr>
				<tr>
					<th style="width:100px;">工作单位：</th>
					<td>
						<input id="company" name="company" class="easyui-textbox" missingMessage="请输入" prompt="请输入" style="width:90%;"
							   data-options="required:false" />
					</td>
				</tr>
				<tr>
					<th style="width:100px;">参展经历：</th>
					<td>
						<input id="experience" name="experience" class="easyui-textbox" style="height: 200px"  data-options="multiline:true,validType:['length[0,500]']" missingMessage="请输入" prompt="请输入"></input>
						已输入<span id="data" style="color: red"></span>/500
					</td>
				</tr>
            </table>
        </div>
	</form>
</body>
</html>